package com.ufo.store.management.net;

import android.app.Activity;

import com.ufo.store.management.entity.ServiceResult;
import com.ufo.store.management.utils.SignUtil;

import org.json.JSONException;
import org.json.JSONObject;


/**
 * Created by Administrator on 2015/8/24 0024.
 */
public class NetHelper {
    public static final int what = 0x01;

    public static void getYSUser(Activity context, NetCallback<ServiceResult> netCallBack, Class<?> rspCls) {
        String postUrl = "https://open.ys7.com:443/api/method";
        String accessTokenJsonString = SignUtil.getAccessTokenRequestJsonStr("18551160792");
        try {
            JSONObject jsonObject = new JSONObject(accessTokenJsonString);
            CallServer.getInstance().post(context, what, postUrl, jsonObject, null, netCallBack, rspCls);
        } catch (JSONException e) {
            e.printStackTrace();
        }
    }

    public static void deleteQiniuRes(Activity context, String postUrl, String host, String contentType, String authorization, NetCallback<ServiceResult> netCallBack, Class<?> rspCls) {
        CallServer.getInstance().postQiNiu(context, what, postUrl,host,contentType, authorization, null, netCallBack, rspCls);
    }
}
